package com.sec.etech.bpm.cust.service;

import lombok.extern.slf4j.Slf4j;
import org.openbpm.bpm.api.engine.action.cmd.InstanceActionCmd;
import org.openbpm.bpm.api.model.inst.IBpmInstance;
import org.openbpm.bpm.api.service.BpmInstanceExtService;
import org.openbpm.bpm.service.DefaultBpmInstanceExtServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;

/**
 * Etech流程任务定制属性服务
 * 新增EtechFlowTask记录流程任务扩展属性并兼容新旧流程系统
 */
@Slf4j
@Service
@ConditionalOnProperty(prefix = "bpm.bpm-ext",name = "instance-ext",havingValue = "cust")
public class EtechInstanceExtServiceImpl extends DefaultBpmInstanceExtServiceImpl implements BpmInstanceExtService {

    @Override
    public void onInstanceStart(InstanceActionCmd instanceActionModel, IBpmInstance instance) {

        log.info("%s",instanceActionModel);
    }

    @Override
    public void onInstanceEnd(InstanceActionCmd instanceActionModel, IBpmInstance instance) {
        log.info("%s",instanceActionModel);

    }
}
